//
//  DJTableTextCell.swift
//  dj-learn-Swift
//
//  Created by Sun Jae on 2022/5/10.
//  Copyright © 2022 S.J. All rights reserved.
//

import UIKit

class DJTableTextCell: UITableViewCell {

    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var textField: UITextField!
    
    override func awakeFromNib() {
        super.awakeFromNib()
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
    }
    
    var model: DJTableItemModel? {
        didSet {
            guard let model = model else { return }
            self.titleLabel.text = model.title
            self.textField.text = model.value
        }
    }
    
    static func loadNib() -> DJTableTextCell {
        return Bundle.main.loadNibNamed("DJTableTextCell", owner: nil, options: nil)?.first as! DJTableTextCell
    }
    
}
